package entity;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Area entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "area", catalog = "house")
public class Area implements java.io.Serializable {

	// Fields

	private Integer id;
	private String AName;
	private Set<Usedhouse> usedhouses = new HashSet<Usedhouse>(0);
	private Set<Commodityhouse> commodityhouses = new HashSet<Commodityhouse>(0);

	// Constructors

	/** default constructor */
	public Area() {
	}

	/** minimal constructor */
	public Area(String AName) {
		this.AName = AName;
	}

	/** full constructor */
	public Area(String AName, Set<Usedhouse> usedhouses,
			Set<Commodityhouse> commodityhouses) {
		this.AName = AName;
		this.usedhouses = usedhouses;
		this.commodityhouses = commodityhouses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "a_name", nullable = false, length = 50)
	public String getAName() {
		return this.AName;
	}

	public void setAName(String AName) {
		this.AName = AName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "area")
	public Set<Usedhouse> getUsedhouses() {
		return this.usedhouses;
	}

	public void setUsedhouses(Set<Usedhouse> usedhouses) {
		this.usedhouses = usedhouses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "area")
	public Set<Commodityhouse> getCommodityhouses() {
		return this.commodityhouses;
	}

	public void setCommodityhouses(Set<Commodityhouse> commodityhouses) {
		this.commodityhouses = commodityhouses;
	}

}